package com.djl.hw02server.controller;

import com.djl.hw02server.bean.Hello;
import com.djl.hw02server.bean.Hi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class HelloController {

    @Resource
    private Hello hello;
    @Autowired
    private Hi hi;

    @RequestMapping("/hello/{name}")
    public String hello(@PathVariable("name") String name){
        return hello.say(name);
    }

    @RequestMapping("/hi/{name}")
    public String hi(@PathVariable("name") String name){
        return hi.say(name);
    }


}
